package yf.mall.vo.app.common;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import yf.mall.entity.AppCategoryEntity;

/**
 * @program: fly-boot
 * @ClassName ClassificationVo
 * @description:
 * @author: yxmds
 * @create: 2023-07-11 15:52
 * @Version 1.0
 **/
@Data
public class ClassificationVo {

    @JSONField(name = "name")
    private String name;

    @JSONField(name = "id")
    private Integer id;

    @JSONField(name = "value")
    private Long value;

    public static ClassificationVo build(AppCategoryEntity appCategoryEntity) {
        ClassificationVo classificationVo = new ClassificationVo();
        classificationVo.setName(appCategoryEntity.getName());
        classificationVo.setId(appCategoryEntity.getId().intValue());
        classificationVo.setValue(appCategoryEntity.getType());
        return classificationVo;
    }
}
